github.com/undoio/delve@v1.9.0/_fixtures/is sue239.go (about) 1 package main 2 3 import ( 4 "fmt" 5 ) 6 7 func fibonacci(n int, c chan int) { 8 x, y := 0, 1 9 for i := 0; i < n; i++ { 10 c <- x 11 x, y = y, x+y 12 } 13 close(c) 14 } 15 16 func main() { 17 a := struct { // set breakpoint here 18 A string 19 B int 20 }{A: "demo", B: 10} 21 fmt.Printf("%#v\n", a) 22 23 c := make(chan int, 10) 24 go fibonacci(cap(c), c) 25 for i := range c { 26 fmt.Println(i) 27 } 28 }